<template>
  <div>
    <div class="place-nav">
      <div class="nav-block">
        <div class="nav">
          <span>全城</span>
          <img width="10" src="@/assets/xiajiantou.png" alt="" />
        </div>|
        <div class="nav">
          <span>品牌</span> 
          <img width="10" src="@/assets/xiajiantou.png" alt="" />
        </div>|
        <div class="nav">
          <span>特色</span> 
          <img width="10" src="@/assets/xiajiantou.png" alt="" />
        </div>
      </div>
    </div>
    <div v-for="item in cinemas" :key="item.id" class="cinema-block">
      <div class="title">
        <span>{{ item.nm }}</span>
        <span class="price">
          <span class="num">{{ item.sellPrice }}</span> 元起
        </span>
      </div>
      <div class="add">
        <span>{{ item.addr }}</span>
      </div>
      <div class="tag">
        <span v-if="item.tag.allowRefund !== 0" class="allowRefund">退</span>
        <span v-if="item.tag.endorse !== 0" class="endorse">改签</span>
        <span v-if="item.tag.snack !== 0" class="snack">小吃</span>
        <span v-if="item.tag.vipTag !== 0" class="vipTag">折扣卡</span>
        <span v-for="(value, key) in item.tag.hallType" :key="key" class="hallType">{{ value }}</span>
      </div>
      <div v-if="item.promotion.cardPromotionTag !== ''" class="promotion">
        <img src="@/assets/card.png" alt="" />
        <span>{{ item.promotion.cardPromotionTag }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "cinema",
  data() {
    return {
      cinemas: [],
      tagTranslation: {
        allowRefund: "退",
        endorse: "改签",
        snack: "小吃",
        vipTag: "折扣卡",
      }
    };
  },
  created() {
    this.$axios
      .get(
        "/ajax/moreCinemas?movieId=0&day=2021-12-09&offset=0&limit=20&districtId=-1&lineId=-1&hallType=-1&brandId=-1&serviceId=-1&areaId=-1&stationId=-1&item=&updateShowDay=true&reqId=1639022836934&cityId=62&optimus_uuid=399952B0533E11ECAE29CD86D772C36E5732B227CFF74BDC9F85E023FBD5BE38&optimus_risk_level=71&optimus_code=10"
      )
      .then(({ data }) => {
        console.log(data);
        this.cinemas = data.cinemas.cinemas;
      });
  },
};
</script>

<style scoped>
  .place-nav{
    width: 100%;
    height: 1.067rem;
    background-color: #fff;
    padding: 0 .48rem;
  }
  .place-nav .nav-block{
    width: 100%;
    height: 1.067rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .place-nav .nav-block .nav{ 
   vertical-align: middle;
  }
  .place-nav .nav-block .nav img{ 
    margin-left: 5px;
   vertical-align: middle;
  }
.cinema-block {
  padding: 0.26rem 0.3rem 0.26rem 0;
  margin-left: 0.3rem;
  background-color: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.title {
  font-size: 16px;
  color: #000;
}
.title .price {
  color: #f03d37;
}
.title .price .num {
  font-size: 18px;
}
.cinema-block > div {
  margin-bottom: 10px;
}

.add {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  line-height: 22px;
}
.tag span {
  color: #589daf;
  border: 0.5px solid #589daf;
  border-radius: 0.04rem;
  padding: 0 0.06rem;
  height: 0.4rem;
  line-height: 0.4rem;
  margin-right: 5px;
  white-space: nowrap;
}

.tag .snack, .tag .vipTag {
  color: #f90;
  border-color: #f90;
}

.promotion {
  display: flex;
  align-items: center;
}
.promotion img {
  width: 0.4rem;
  height: 0.3735rem;
  margin-right: 5px;
}
</style>
